from reward_component import RewardComponent

class ResourceUtilizationComponent(RewardComponent):
    """资源利用率奖励组件"""
    def __init__(self, weight=1.0, coefficient=0.5):
        super().__init__(weight)
        self.coefficient = coefficient
        
    def calculate(self, current_activity, next_activity, case_events, context=None):
        return self.coefficient * get_resource_utilization(next_activity)
    
    def get_description(self):
        return "基于资源利用率的奖励"